home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / Harvest C / MPW Int & Lib / Interfaces / CType.h < prev    next >
Text File  |  1991-04-17  |  2KB  |  76 lines

  1. /************************************************************
  2.  
  3.     CType.h
  4.     Character handling
  5.     
  6.     Copyright American Telephone & Telegraph
  7.     Used with permission, Apple Computer Inc.    1985-1990.
  8.     All Rights Reserved.
  9.  
  10. ************************************************************/
  11.  
  12.  
  13. #ifndef __CTYPE__
  14. #define __CTYPE__
  15.  
  16. /*       @(#)ctype.h        2.1  */
  17. /*       3.0 SID #         1.2      */
  18. #define _U         01
  19. #define _L         02
  20. #define _N         04
  21. #define _S         010
  22. #define _P         020
  23. #define _C         040
  24. #define _B         0100
  25. #define _X         0200
  26.  
  27. extern char * const __p_CType;
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32.  
  33. int isalnum (int c);
  34. #define isalnum(c)        ((__p_CType)[c]&(_U|_L|_N))
  35. int isalpha (int c);
  36. #define isalpha(c)        ((__p_CType)[c]&(_U|_L))
  37. int iscntrl (int c);
  38. #define iscntrl(c)        ((__p_CType)[c]&_C)
  39. int isdigit (int c);
  40. #define isdigit(c)        ((__p_CType)[c]&_N)
  41. int isgraph (int c);
  42. #define isgraph(c)        ((__p_CType)[c]&(_P|_U|_L|_N))
  43. int islower (int c);
  44. #define islower(c)        ((__p_CType)[c]&_L)
  45. int isprint (int c);
  46. #define isprint(c)        ((__p_CType)[c]&(_P|_U|_L|_N|_B))
  47. int ispunct (int c);
  48. #define ispunct(c)        ((__p_CType)[c]&_P)
  49. int isspace (int c);
  50. #define isspace(c)        ((__p_CType)[c]&_S)
  51. int isupper (int c);
  52. #define isupper(c)        ((__p_CType)[c]&_U)
  53. int isxdigit (int c);
  54. #define isxdigit(c)        ((__p_CType)[c]&_X)
  55.  
  56. int tolower (int c);
  57. int toupper (int c);
  58.  
  59. #ifndef __STDC__
  60.  
  61. int isascii (int c);
  62. #define isascii(c)        ((unsigned char)(c)<=0177)
  63.  
  64. #define __tolower(c)    ((c)-'A'+'a')
  65. #define __toupper(c)    ((c)-'a'+'A')
  66. int toascii (int c);
  67. #define toascii(c)        ((c)&0177)
  68.  
  69. #endif
  70.  
  71. #ifdef __cplusplus
  72. }
  73. #endif
  74.  
  75. #endif
  76.